﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApp
{
    public struct MyStruct
    {
        public int value;
        public void SetValue(int value)
        {
            this.value = value;
        }
    }

    public struct MyStruct2
    {
        public int value;
        public int Increment()
        {
            return ++value;
        }
    }

    public class demo_struct
    {
        static readonly MyStruct2 ms2;

        public static void demo()
        {
            var ms = new MyStruct();
            Action<int> action = ms.SetValue;
            action(45);
            Console.WriteLine(ms.value); // 经测试输出0

            Console.WriteLine(ms2.Increment());
            Console.WriteLine(ms2.Increment());
        }
    }
}